/*----------------------------------------------------------
* FILE: ServiceGenericAbstractImpl.java
* LOGICAL NAME: ServiceGenericAbstractImpl
* PRODUCT: bila-framework
*----------------------------------------------------------
* MODIFICATIONS
* DATE Oct 9, 2011
* AUTHOR wjuarez
*----------------------------------------------------------
*/

package bila.framework.services.impl;

import java.io.Serializable;
import java.util.List;

import bila.framework.services.ServiceGeneric;

/**
 * @author WJuarez
 * <b>Created by </b>wjuarez
 * <b>for</b> bila-framework
 * <b>package</b> bila.framework.services.impl
 * <b>on</b> Oct 9, 2011 10:03:51 PM
 * <b>Purpose</b> 
 * <p>
 *		Implementacion de ServiceGeneric sin la implementacion de los metodos para crear Model y Dto
 * </p>
 */
public abstract class ServiceGenericAbstractImpl<Dto, Model, ModelId extends Serializable> extends ServiceFinderAbstractImpl<Dto, Model, ModelId> implements ServiceGeneric<Dto, Model, ModelId> {

	public ServiceGenericAbstractImpl(Class<Dto> dtoClass,
			Class<Model> modelClass, Class<ModelId> modelIdClass) {
		super(dtoClass, modelClass, modelIdClass);
	}

	/*
	 * (non-Javadoc)
	 * @see bila.framework.services.ServiceGeneric#save(java.lang.Object)
	 */
	public void save(Dto dto) throws Exception{
		Model model = createModel(dto);
		getDao().save(model);
	}

	/*
	 * (non-Javadoc)
	 * @see bila.framework.services.ServiceGeneric#update(java.lang.Object)
	 */
	public void update(Dto dto) throws Exception{
		Model model = createModel(dto);
		getDao().update(model);
	}

	/*
	 * (non-Javadoc)
	 * @see bila.framework.services.ServiceGeneric#delete(java.lang.Object)
	 */
	public void delete(Dto dto) throws Exception{
		Model model = createModel(dto);
		getDao().delete(model);
	}

	/*
	 * (non-Javadoc)
	 * @see bila.framework.services.ServiceGeneric#saveOrUpdate(java.lang.Object)
	 */
	public void saveOrUpdate(Dto dto) throws Exception{
		Model model = createModel(dto);
		getDao().saveOrUpdate(model);
	}

	/*
	 * (non-Javadoc)
	 * @see bila.framework.services.ServiceGeneric#saveOrUpdateList(java.util.List)
	 */
	public void saveOrUpdateList(List<Dto> list) throws Exception{
		List<Model> modelList = createModelList(list);
		getDao().saveOrUpdateList(modelList);
	}

	/*
	 * (non-Javadoc)
	 * @see bila.framework.services.ServiceGeneric#deleteList(java.util.List)
	 */
	public void deleteList(List<Dto> list) throws Exception{
		List<Model> modelList = createModelList(list);
		getDao().deleteList(modelList);
	}

}
